package com.wn.procurement.redis;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfiguration {

    //配置redisson 用于分布式锁
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://42.192.223.28:6379");
        config.useSingleServer().setPassword("123321");
        return Redisson.create(config);
    }
}
